#
# jython examples for jas.
# $Id$
#

import sys;

from jas import Ring
from jas import Ideal
from jas import startLog
from jas import terminate

# example from rose (modified)

#r = Ring( "Mod 19 (U3,U4,A46) L" );
#r = Ring( "Mod 1152921504606846883 (U3,U4,A46) L" ); # 2^60-93
#r = Ring( "Quat(U3,U4,A46) L" );
#r = Ring( "Z(U3,U4,A46) L" );
#r = Ring( "C(U3,U4,A46) L" );

r = Ring( "Rat(A46,U3,U4) L" );
print "Ring: " + str(r);
print;

ps = """
(   
 %s
 ( U4^4 - 20/7 A46^2 ), 
 ( A46^2 U3^4 + 7/10 A46 U3^4 + 7/48 U3^4 - 50/27 A46^2 - 35/27 A46 - 49/216 ), 
 ( A46^5 U4^3 + 7/5 A46^4 U4^3 + 609/1000 A46^3 
 U4^3 + 49/1250 A46^2 U4^3 - 27391/800000 A46 U4^3 
 - 1029/160000 U4^3 + 3/7 A46^5 U3 U4^2 + 3/5 A46^6 
 U3 U4^2 + 63/200 A46^3 U3 U4^2 + 147/2000 A46^2 
 U3 U4^2 + 4137/800000 A46 U3 U4^2 - 7/20 A46^4 
 U3^2 U4 - 77/125 A46^3 U3^2 U4 - 23863/60000 A46^2 
 U3^2 U4 - 1078/9375 A46 U3^2 U4 - 24353/1920000 
  U3^2 U4 - 3/20 A46^4 U3^3 - 21/100 A46^3 U3^3 
 - 91/800 A46^2 U3^3 - 5887/200000 A46 U3^3 
 - 343/128000 U3^3 ) 
) 
""";

pp1 = """
 ( 20 A46 + 7 ),
""";

pp2 = """
 ( 5480334637123239936000000000000000000 A46^32 + 23330567455181792870400000000000000000 A46^31 - 22260410953422455439360000000000000000 A46^30 - 379039147753503876710400000000000000000 A46^29 - 1305289515920841108357120000000000000000 A46^28 - 2661894008686715272062566400000000000000 A46^27 - 3732109213267597335472373760000000000000 A46^26 - 3719328899522099347074318336000000000000 A46^25 - 2513175000419852400394764288000000000000 A46^24 - 801907472074794268996141056000000000000 A46^23 + 559468735767998648283977220096000000000 A46^22 + 1161692745234469227508358814105600000000 A46^21 + 1115120737963786660933876454522880000000 A46^20 + 754183677763034219243933188227072000000 A46^19 + 366205139138005719200006792439398400000 A46^18 + 95407136698255889087520898673541120000 A46^17 - 35897763757636362165902256717692928000 A46^16 - 68696958358719191677546842722559590400 A46^15 - 55382563098545072682320366954843996160 A46^14 - 32223104574376823941781148035505979392 A46^13 - 14867126462105106300205537184606126080 A46^12 - 5596017809975575801376014016653721600 A46^11 - 1730893404306213749794640488178116608 A46^10 - 438698743729822786570094575456788480 A46^9 - 90199241991532353478039712103521280 A46^8 - 14778859703096558479650421488297984 A46^7 - 1874056025467134008603806670325120 A46^6 - 174876413639867324175892636604160 A46^5 - 10843113615171040141214782270464 A46^4 - 325577720150105105056746125600 A46^3 + 6040454553390756509792153750 A46^2 + 761038687880048862537750000 A46 + 13745464623924567359765625 ),
""";

pp = ps % pp1;

f = Ideal( r, pp );
print "Ideal: " + str(f);
print;

startLog();

rg = f.GB();
print "seq Output:", rg;
print;

#sys.exit();


